package unitTest;

import utils.*;
/**
 * unit-test class for ByteArrUtils static methods
 * @author yuvalshu
 *
 */
public class UtilTester {
	public static void main(String[] args) {
		int i = 7778;
		byte[] ib = ByteArrUtils.intToByteArray(i);
		for(int j=0;j<ib.length;j++){
			System.out.printf("the " +j+" byte is 0x%02X", ib[j]);
			System.out.println();
		}
		int n = ByteArrUtils.byteArrayToInt(ib);
		
		System.out.println("the byte array interpeted to " + n);
		String str = "0000000002010000001c766572696669636174756d2e61726974686d2e";
		byte[] strb = ByteArrUtils.hexStringToByteArray(str);
		for(int j=0;j<strb.length;j++){
			System.out.printf("the " +j+" byte is 0x%02X", strb[j]);
			System.out.println();
		}
		String str2 = ByteArrUtils.ByteArrayToHexString(strb);
		System.out.println("the byte array interpeted to " + str2);
	}
	

	

}
